fn sort([int] list) {
    var len = list.len()
    for int i = 0; i < len - 1; i += 1 {
        for int j = 0; j < len - i - 1; j += 1 {
            if list[j] > list[j + 1] {
                (list[j], list[j + 1]) = (list[j + 1], list[j])
            }
        }
    }
}

var list = [2, 8, 4, 2, 3]

fn main() {
    sort(list)

    for v in list {
        println(v)
    }
}

